package com.wxlsoft.excel.convert.handlers;


import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;

import com.alibaba.excel.write.handler.RowWriteHandler;
import com.alibaba.excel.write.handler.context.RowWriteHandlerContext;

/**
 * 必须设置 否则背景色不生效
 * Workbook wb = new XSSFWorkbook();
 * CellStyle titleStyle = wb.createCellStyle();
 * titleStyle.setFillForegroundColor(IndexedColors.AQUA.getIndex());
 * titleStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
 * @author wangxiaoliang
 */
public class ServiceEmptyOutsWriteHandler implements RowWriteHandler {

	public static final String DELETESTRING = "byDelete";

	@Override
    public void afterRowDispose(RowWriteHandlerContext context) {
		Row row = context.getRow();
		Cell cell = row.getCell(6);
		
		if (DELETESTRING.equals(cell.getStringCellValue())) {
			row.getSheet().removeRow(row);
		}
    }

}
